﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace NUtils
{
    public partial class AutoScrollBox : UserControl
    {

        public AutoScrollBox()
        {
            InitializeComponent();
        }

        public override string Text
        {
            get
            {
                return this.richTextBox.Text;
            }
            set
            {
                this.richTextBox.Text = value;
            }
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            SuspendLayout();

            richTextBox.Select( richTextBox.Text.Length-1, 0);
            richTextBox.ScrollToCaret();

            ResumeLayout(true);
        }
    }
}
